<?php
/**
 * Created by PhpStorm.
 * User: mj
 * Date: 17-5-24
 * Time: 上午11:57
 */

namespace App\Winged\Patients\Controllers;


use App\Winged\Backend\Oss\OSS;
use Symfony\Component\HttpFoundation\Request;

class FileController extends BaseController
{
    //e0f54cc15d0a432f9ecf0ec06b8b38d0/7e35727ca524360e8b71b67d1e73ff06.png
    public function index(Request $request){
        $file = $request->input('file');
        if(is_null($file)){
            return false;
        }
        $real_file = OSS::plugin('sign')->doSign($file);
        $real_file = file_get_contents($real_file);
        return response($real_file)->header('Content-Type','image/jpeg');
    }
}